from django.db import models

# Create your models here.
from merchant.models import BusinessAccountNumber

class activityInformation(models.Model):
    activity_name = models.CharField(verbose_name="活动标题",max_length=128,)
    business_describe = models.CharField(verbose_name="给商家的描述",max_length=200,)
    describe = models.CharField(verbose_name="活动描述",max_length=200,)
    discount = models.IntegerField(verbose_name="优惠")
    business_id = models.ManyToManyField(BusinessAccountNumber, through="businessActivity")

    def __str__(self):
        return self.activity_name

# 商家申请
class businessActivity(models.Model):
    activity_id = models.ForeignKey(activityInformation,on_delete=id)
    business_id = models.ForeignKey(BusinessAccountNumber,on_delete=id)
    consent = models.BooleanField(verbose_name="是否通过申请", default=False)

    def __str__(self):
        return self.activity_id + " -- " + self.business_id + " : " + self.consent